/**
 * Created by 叶子 on 2017/8/13.
 */
import React, { Component } from 'react';
// import { Router, Route, hashHistory, IndexRedirect } from 'react-router';
import { Route, Redirect, Switch } from 'react-router-dom';
import VipCard from '../components/vipcard/index.jsx'
import Members from '../components/members';



export default class CRouter extends Component {
    requireAuth = (permission, component) => {
        const { auth } = this.props;
        const { permissions } = auth.data;
        // const { auth } = store.getState().httpData;
        if (!permissions || !permissions.includes(permission)) return <Redirect to={'404'} />;
        return component;
    };
    render() {
        return (
            <Switch>
                <Route exact path="/app/vipcard" component={VipCard} />
                <Route exact path="/app/members" component={Members} />
                
                <Route render={() => <Redirect to="/404" />} />
            </Switch>
        )
    }
}